package com.wjb.xietong.server.topic;

import java.util.HashMap;
import java.util.Map;

import com.wjb.xietong.server.IRequestParam;
import com.wjb.xietong.util.IDs;

public class ReplyParam implements IRequestParam {
	private long topicId = 0l;
	private long userId = 0l;
	private long companyId = 0l;
	private int zanType = -1;// (0:取消赞 1:点赞)
	/** 如果是点赞content不需要填 **/
	private String content = null;// 评论内容

	@Override
	public Map<String, String> parseData2Map() {
		Map<String, String> map = new HashMap<String, String>();
		if (getZanType() != -1) {// 如果不是初始值，那么就是点赞
			put(map, IDs.M, IDs.MOBILE_ZAN);
			put(map, IDs.ZAN_TYPE, getZanType());
		} else {
			put(map, IDs.M, IDs.MOBILE_REPLY_TOPIC);
			put(map, IDs.CONTENT, getContent());
		}
		put(map, IDs.COM_ID, getCompanyId());
		put(map, IDs.USER_ID, getUserId());
		put(map, IDs.TOPIC_ID, getTopicId());
		return map;
	}

	private void put(Map<String, String> map, String key, long value) {
		put(map, key, String.valueOf(value));
	}

	private void put(Map<String, String> map, String key, int value) {
		put(map, key, String.valueOf(value));
	}

	private void put(Map<String, String> map, String key, String value) {
		if (null == key || null == value) {
			return;
		}
		map.put(key, value);
	}

	public long getTopicId() {
		return topicId;
	}

	public void setTopicId(long topicId) {
		this.topicId = topicId;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(long companyId) {
		this.companyId = companyId;
	}

	public int getZanType() {
		return zanType;
	}

	public void setZanType(int zanType) {
		this.zanType = zanType;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
